import request from "./request"
/* 
    1、request.get("/index/index")发起请求
    2、()=>箭头函数作为发请求的返回值

 */
// 首页数据
export const GetHomeData = () => request.get("/index/index")
    // 搜索页面数据
export const GetSearchPopupData = () => request.get("/search/index")
    // 搜索提示列表
export const GetSearchTipsListData = (params) => request.get("/search/helper", { params })

// 搜索产品列表
export const GetGoodsListData = (params) => request.get("/goods/list", { params })
    // 清除搜索历史记录
export const ClearSearchHistory = () => request.post("/search/clearhistory")
    // 发送登录请求
export const GoLogin = (params) => request.post("/auth/loginByWeb", params)


/* 
    带参数get、post请求写法
    1、
    export const GetSearchTipsListData = (keyword) => request.get("/search/helper",{
        params:{
            keyword:keyword
        }
    })
    2、
    export const GetSearchTipsListData = (keyword) => request.get("/search/helper",{
        params:{
            keyword
        }
    })
    3、
    export const GetSearchTipsListData = (params) => request.get("/search/helper", { params })
 */